// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 供货商分页 GET /supplyChain/supplier */
export async function listPage(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listPageParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageRespSupplyChainSupplierAccountVo>(
    `/barter-user/supplyChain/supplier`,
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 新增供货商 POST /supplyChain/supplier */
export async function add(
  body: API.SupplyChainSupplierAccountDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/supplyChain/supplier`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 供货商详情 GET /supplyChain/supplier/${param0} */
export async function detail(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.detailParams,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseSupplyChainSupplierAccountVo>(
    `/barter-user/supplyChain/supplier/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 编辑供货商 PUT /supplyChain/supplier/${param0} */
export async function edit(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.editParams,
  body: API.SupplyChainSupplierAccountDto,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/supplier/${param0}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 删除供货商 DELETE /supplyChain/supplier/${param0} */
export async function del8(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.del8Params,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/supplier/${param0}`,
    {
      method: "DELETE",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 状态切换 POST /supplyChain/supplier/disable */
export async function disable(
  body: API.IdDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/supplier/disable`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}
